<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import = "com.ipt.frm.pw.Utilidades"%>
<%@ page import = "java.util.ArrayList"%>
<%@ page import = "java.util.Iterator"%>
<%@ page import = "com.ipartek.fila2.bean.Alumno"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Ranking de Alumnos</title>
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery.dataTables.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.dataTables_themeroller.css">
<link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<script>
	$( document ).ready(function() {
		$("#tabla").DataTable();
	});
</script>
	<fieldset>
		<legend>
			Ranking de las tiradas de los Alumnos
		</legend>
	<table border="1" id="tabla">
	<thead>
		<tr>
			<th>Nombre</th>
			<th>Primer Apellido</th>
			<th>Segundo Apellido</th>
			<th>Email</th>
			<th>DNI</th>
			<th>Numero de tiradas</th>
		</tr>
	</thead>
	<tfoot>
		<td colspan="2"> Pie de Pagina </td>
	</tfoot>
	<tbody>
		<!-- Escribimos una fila por cada objeto -->
			<% 
			ArrayList <Alumno> lista = (ArrayList<Alumno>) request.getAttribute("lista");
			Iterator <Alumno> it = lista.iterator();
			Alumno alumno;
			while(it.hasNext()){
				alumno = it.next();
				out.print("<tr><td>" + alumno.getNombre() + "</td>");
				out.print("<td>" + alumno.getApellido1() + "</td>");
				out.print("<td>" + alumno.getApellido2() + "</td>");
				out.print("<td>" + alumno.getApellido1() + "</td>");
				out.print("<td>" + alumno.getDni() + "</td>");
				out.print("<td>" + alumno.getNum_tiradas() + "</td></tr>");
			}
			 %>
	</tbody>
	</fieldset>
	</table>
</body>
</html>